#ifndef __ETHERNET2__H__
#define __ETHERNET2__H__

#define ETHERNET2_HAVE_CRC	1
#define ETHERNET2_HAVE_DUMP	0

typedef struct ETHERNET2_INTERFACE_S
{
	unsigned char *data;
	unsigned int data_size;
	unsigned short data_type;
	unsigned char tomac[6];
	unsigned char mymac[6];
	unsigned int size;
	int (*alloc)(struct ETHERNET2_INTERFACE_S *, unsigned char *, unsigned short, unsigned char *, unsigned int);
#if ETHERNET2_HAVE_DUMP
	void (*dump)(struct ETHERNET2_INTERFACE_S *);
#endif
	int (*tobuf)(struct ETHERNET2_INTERFACE_S *, unsigned char *, int);
	int (*free)(struct ETHERNET2_INTERFACE_S *);
} ETHERNET2_INTERFACE_T, *ETHERNET2_INTERFACE_P;

extern void ethernet2_init(unsigned char *);
extern void ethernet2_get_interface(ETHERNET2_INTERFACE_P *);

#if ETHERNET2_HAVE_CRC
#define ETHERNET2_HEAD_SIZE	18
#else
#define ETHERNET2_HEAD_SIZE	14
#endif

#define ETHERNET2_TYPE_IP	0x0800
#define ETHERNET2_TYPE_ARP	0x0806

#endif